<?php 

function send_load_admin_lab_details()
{
   if(isset($_SESSION['logged_in']) && $_SESSION['permissions'] == "Admin")
      return true;
}

function send_menu_admin_lab_details() 
{
   return "<a href=?q=admin_lab_details>Read lab_details</a><br>";
}

function send_content_admin_lab_details() 
{
   if(isset($_GET['q']) && $_GET['q'] == "admin_lab_details")
  {
      $query = "select * from lab";
      $result = mysql_query($query);
      $num = mysql_num_rows($result);
      if($num == 0)
         return "No Lab Registration available";

      $content = "";
      $count = 1;
      while($row = mysql_fetch_array($result))
      {
         $content .= "$count.  Name - $row[0] , ID- $row[2], Lab - $row[1]<br><br>";
         $content .= "Faculty - $row[3], Date - $row[4], Time - $row[5]<br><br>";
		 $content .= "Comments - $row[6]<br>";
         $content .= "<a href=?q=admin_lab_details_delete&id=$row[7]>Delete Record</a><br><hr>";
         $count++;

      }      
      return $content;
    }
    else if(isset($_GET['q']) && $_GET['q'] == "admin_lab_details_delete")
    {
       $id = $_GET['id'];
       $query = "delete from lab where id = $id";
       $result = mysql_query($query);
       if(!$result)
          return "Error deleting Record";
       else
          return "Record deleted";
    }     
}

function send_content_other_admin_lab_details() 
{

}

?>
